#include <iostream>

using namespace std;
// void swap(int &a, int &b) // reference  propagation
void swap(int a, int b) // value propagation
{
    cout << "FUNCTION void swap(int a, int b)" << endl;
    cout << "before swap: " << endl;
    cout << "a = " << a << endl;
    cout << "b = " << b << endl;

    int temp = a;
    a = b;
    b = temp;
    cout << "after swap: " << endl;
    cout << "a = " << a << endl;
    cout << "b = " << b << endl;
}

int main(int argc, char const *argv[])
{

    int a = 100;
    int b = 200;

    cout << " before main : a = " << a << endl;
    cout << " before main : b = " << b << endl;

    cout << endl;
    swap(a, b);
    cout << endl;
    cout << " after main : a = " << a << endl;
    cout << " after main : b = " << b << endl;

    return 0;
}
